SCComponent = sCore.makeClass(SCStruct,{
    init: function() {
        $.extend(this,arguments[0]);
    },
    create : function() {
        var i,c,cc;
        for (i=0;i<(cc=this.$()).size();i++)
            cc.get(i).$ = this;
    },
    getControlFullName : function() {
        if (this.parent) return this.parent.getControlFullName()+sCore.cnd+this.name;
        return this.name;
    },
    
    _$ : null,
    $ : function() {
        return this._$==null?(this._$=$("[id='"+this.getControlFullName()+"']")):this._$;
    },
    
    triggerEvent : function(eventName) {
        sCore.site.triggerEvent(this,eventName);
        return this;
    },
    
    collectPost : function(args){
    //collect state args
    },
    
    //proxies to $
    click : function() {
        return this.$().click.apply(this.$(),arguments);
    },
    data : function() {
        return this.$().data.apply(this.$(),arguments);
    },
    css : function() {
        return this.$().css.apply(this.$(),arguments);
    },
    html : function(){
        return this.$().html.apply(this.$(),arguments);
    },
    Rerender : function(html) {
        var t = $(html),n=t.get(0).attributes,nn,$this=this.$();
        for (var i=0;i<n.length;i++) 
            if (!((nn=n[i]).name in {
                type:1,
                name:1,
                id:1
            }))
                $this.attr(nn.name,nn.value);
        if (t.html().length) $this.html(t.html());
    }
});
Component = sCore.makeClass(SCComponent,{});